package com.example.chunqiubackend.controller;

import com.example.chunqiubackend.pojo.Course;
import com.example.chunqiubackend.pojo.Result;
import com.example.chunqiubackend.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/course")
public class CourseController {

    @Autowired
    private CourseService courseService;

    // 获取所有课程（测试）
    @GetMapping()
    public Result<List<Course>> list(){
        List<Course> list = courseService.list();
        return Result.success(list);
    }

    //
}